<?php if(!defined('APP_ROOT')){exit('error!');}?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $site_title;?></title>
<link type="text/css" href="<?php echo PUBLIC_URL;?>css/font-awesome.min.css" rel="stylesheet">
<link type="text/css" href="<?php echo TEMPLATE_URL;?>style.css" rel="stylesheet">
<script type="text/javascript" src="<?php echo PUBLIC_URL;?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo TEMPLATE_URL;?>js/manage.js"></script>
</head>
<body>
<?php include View::getView('header');?>
<?php include View::getView('side');?>
<div id="mainbox">
    <div class="wrapper">
        <div class="main">
            <div class="itembox w100">
                <div class="wrap">
                    <h2><?php echo $page_title;?></h2>
                    <div class="itemmain">
                        <div id="adm_setting">
                            <form name="editForm" onsubmit="return postEditForm();">
                                <table width="100%" cellpadding="0" cellspacing="0" class="adm_table">
                                    <tr>
                                        <td width="150">站点名称</td>
                                        <td><input type="text" name="site_name" value="<?php echo $site_name;?>" class="bar bar1"></td>
                                    </tr>
                                    <tr>
                                        <td>站点地址</td>
                                        <td><input type="text" name="site_url" value="<?php echo $site_url;?>" class="bar bar1"></td>
                                    </tr>
                                    <tr>
                                        <td>站点关键词</td>
                                        <td><input type="text" name="site_keyword" value="<?php echo $site_keyword;?>" class="bar bar3"></td>
                                    </tr>
                                    <tr>
                                        <td>站点描述</td>
                                        <td><textarea name="site_description" class="text1 text"><?php echo $site_description;?></textarea></td>
                                    </tr>
                                    <tr>
                                        <td>登录安全密码</td>
                                        <td><input type="password" name="safecode" value="<?php echo $safecode;?>" class="bar bar1"></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td style="padding:30px 20px 40px;">
                                            <input type="hidden" name="action" value="save">
                                            <input type="hidden" name="token" value="<?php echo loginAuth::genToken();?>">
                                            <input type="submit" value="提交保存" class="btn">
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php include View::getView('footer');?>
    </div>
</div>
<script type="text/javascript">
function postEditForm(){
    var theData = $("form[name=editForm]").serialize();
    $.ajax({
        'type':'post',
        'dataType':'json',
        'url':'<?php echo APP_URL;?>options/handle',
        'data':theData,
        'success':function(data){
            alert(data.msg);
        }
    });
    return false;
}
</script>
</body>
</html>